import React, { useState } from 'react';

export default function Testfour() {
  console.log('reander 渲染');
  const [x, setX] = useState(10);
  const handle = () => {
    for (let i = 0; i < 10; i++) {
      setX(x + 1);
    }
  };
  //点击按钮之后更新1次,x变成11
  return (
    <>
      <span>x:{x}</span>
      <button onClick={handle}>新增</button>
    </>
  );
}
